<template>
  <div class="box">
    <h5>子组件</h5>
    <div>接收到父组件传参:{{ value }}</div>
    <button @click="addValue">修改value</button>
  </div>
</template>
<script>
export default {
  props: {
    value: {
      type: Number,
      required: false
    }
  },
  methods: {
    addValue () {
      this.$emit('input', this.value + 1)
    }
  }
}
</script>
<style>
.box {
  width: 200px;
  height: 200px;
  border: 5px solid red;
}
</style>
